<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>2-伪元素before-after</title>
		<style type="text/css">
			*{
				margin:0;
				padding:0;
			}
			.box{
				width:300px;
				height:300px;
				background:red;
			}
			
			
			/*伪元素before*/
 			.box::before{
 				content: "";
 				width: 100px;
 				height:100px;
 				/*伪元素默认是行类元素，设置宽高需要转换...*/
 				display: block;
 				background:blue;
 			}
			/*伪元素after*/
			.box::after{
				content: "伪元素内容end";
				background: #27BA9B;
				width:100px;
				height:100px;
				display: inline-block;
			}
			
			
		</style>
	</head>
	<body>
		<div class="box">
			百度
		</div>
	</body>
</html>
